package com.dufang.thread03Join;

import com.dufang.thread04Yield.Thread01;

/**
 * @ClassName:Test
 * @Description 插入线程
 * @Author Administrator
 * @Date 2025/7/7/007 7:12
 * @Version 1.0
 **/
public class Test {
    public static void main(String[] args) throws InterruptedException {
        Thread01 t1=new Thread01();
        t1.setName("张三");
        t1.start();

        //表示把t1插入到当前线程之前，t1要插到main线程之前，索引当前线程就是main线程
        t1.join();

        for (int i = 0; i < 10; i++) {
            System.out.println(Thread.currentThread().getName()+"执行了。。。。"+i);
        }
    }
}
